package com.ht.medicaltreatment.adapter

import android.graphics.Color
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.HaoCaiShenQingListBean

class HaoCaiShenQingAdapter : BaseQuickAdapter<HaoCaiShenQingListBean.DataBean.PageListBean,BaseViewHolder>(R.layout.item_haocaishenqing_layout) {

    override fun convert(holder: BaseViewHolder, item: HaoCaiShenQingListBean.DataBean.PageListBean) {
        holder.setText(R.id.tvCode,"${getItemPosition(item)+1}")
        holder.setText(R.id.tvName,item.name)
        if(item.status == 0){
            holder.setText(R.id.tvState,"待审批")
            holder.setTextColor(R.id.tvState,Color.BLACK)
        }else if(item.status == 1){
            holder.setText(R.id.tvState,"同意")
            holder.setTextColor(R.id.tvState,Color.GREEN)
        }else if(item.status == 2){
            holder.setText(R.id.tvState,"驳回")
            holder.setTextColor(R.id.tvState,Color.RED)
        }
        holder.setText(R.id.tvTime,item.createTime)
    }
}
